<script>
import AppNav from '@/components/AppNav.vue';
import AppHeader from '@/components/AppHeader.vue';
import AppFooter from '@/components/AppFooter.vue';
import {useCategoryStore} from '@/store/modules/category';
import AppHeaderSticky from "@/components/AppHeaderSticky.vue";
// import { onMounted } from 'vue'

export default {
  name: 'XtxLayout',
  components: {
    AppHeaderSticky,
    AppNav,
    AppHeader,
    AppFooter
  },
  // eslint-disable-next-line
  setup(props, context) {
    const categoryStore = useCategoryStore();
    const {getList} = categoryStore
    // 组件初始化时，调用getlist获取分类数据
    getList()
  }
}
</script>


<template>
  <!-- 导航栏 -->
  <AppNav></AppNav>
  <!-- 头部 -->
  <AppHeader></AppHeader>
  <AppHeaderSticky/>
  <main class="app-body">
    <router-view></router-view>
  </main>
  <!-- 底部 -->
  <AppFooter></AppFooter>
</template>


<style scoped lang="less">
.app-body {
  min-height: 600px;
}
</style>